﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;


public class Background : MonoBehaviour
{

    public GameObject DebugTile;

    public float m_fTileStartPosX = -5.0f;
    public float m_fTileStartPosY = 4.5f;

    public int m_iTileCountX = 52;
    public int m_iTileCountY = 100;

    public List<GameObject> m_ListTile;

    

    // Use this for initialization
    void Start()
    {
        for (int i = 0; i < m_iTileCountY; ++i)
        {
            for (int j = 0; j < m_iTileCountX; ++j)
            {
                GameObject Tile = Instantiate(DebugTile, new Vector3(m_fTileStartPosX + (j * 0.15f), m_fTileStartPosY - (i * 0.15f), 0.0f), Quaternion.identity) as GameObject;
                Tile.transform.parent = GameObject.Find("DebugTile").transform;
                Tile.GetComponent<Tile>().m_iIndex = ((i * m_iTileCountX) + j);
                m_ListTile.Add(Tile);
                
            }
        }
        
    }

    // Update is called once per frame
    void Update()
    {
        //if(Input.GetMouseButtonDown(0))
        //m_ListTile[Calculate.GetMyTileIdx(Calculate.GetMousePos())].GetComponent<Tile>().m_iOption = 1;
    }
}
